import request from '@/utils/request'
// 分页查询车辆信息
export function getCarInfo(params) {
  console.log(params)
  return request({
    url: '/business/car/getPage',
    params: {
      ...params
    }
  })
}

// 新增车辆
export function addCar(data) {
  console.log(data)
  return request({
    url: '/business/car/save',
    method: 'post',
    data
  })
}

// 查询车牌是否存在
export function searchCarNum(carNum) {
  return request({
    url: 'business/car/repeat',
    params: carNum
  })
}

// 修改车辆
export function alterCar(data) {
  return request({
    url: '/business/car/edit',
    method: 'post',
    data
  })
}

// 删除车辆
export function deleteCar(data) {
  return request({
    url: '/business/car/delete',
    method: 'post',
    data
  })
}

// 根据车牌号获取车辆详情
export function getCarDetailByCarNumber(carNumber) {
  console.log(carNumber)
  return request({
    url: '/business/car/getListByCarNumber',
    params: carNumber
  })
}

// 设置车辆黑名单
export function setCarBlackName(params) {
  return request({
    url: '/business/car/setBlackName',
    params: {
      ...params
    }
  })
}
//导出列表
export function exportlistcar(data) {
  return request({
    url: '/business/car/export',
    params: data,
    responseType: 'blob'
  })
}
// 下载模版
export function getTemplate(data) {
  return request({
    url: '/business/car/getTemplate',
    params: data,
    responseType: 'blob'
  })
}
